package com.yidiandao.business.ui.widget.listview.displaylistitem;

import android.app.Activity;
import android.content.Context;
import android.view.View;

import com.yidiandao.business.data.imagemodule.ImageAD;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;
import com.yidiandao.business.ui.widget.listview.viewholder.HomeOneBigImageHolder;
import com.yidiandao.business.utils.ImageLoader;
import com.yidiandao.business.utils.JumpUtils;

/** 首页-活动大图-ListItem */
public class HomeOneBigImageListItem extends DisplayListItem<HomeOneBigImageHolder, ImageAD> {

    public HomeOneBigImageListItem(ImageAD s) {
        super(s);
    }

    @Override
    public void onShow(final Context context, HomeOneBigImageHolder holder) {
        ImageLoader.loadImage(context, holder.ivImage, data.getImage());

        holder.ivImage.setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        JumpUtils.clickImageAD((Activity) context, data);
                    }
                });
    }

    @Override
    public String getDisplayItemTag() {
        return HomeOneBigImageListItem.class.getSimpleName();
    }

    @Override
    public Class<HomeOneBigImageHolder> getViewHolderClazz() {
        return HomeOneBigImageHolder.class;
    }
}
